package com.ticket.sass.common.ticketserver

import com.ticket.sass.common.ticketserver.configure.Config
import org.springframework.stereotype.Component


/**
 * @author 朱其鹏
 * @date 2023/12/11 21:39
 */
@Component
class TicketServerBuilder {
    /**
     * 构建 API
     *
     * @param config 系统配置信息
     */
    fun apiBuild(config: Config): ApiInterface {
        return (SpringContextHolder.getBean("ticketserver.${config.platform.value}.ApiInterfaceImpl") as ApiInterface).also {
            it.config = config
        }
    }
}